<template>
  <div>
    <h2>Child</h2>
    {{ props.msg }}
    <button @click="handleClick">给父组件传递数据</button>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'
const props = defineProps(['msg'])
console.log(props.msg)

const emits = defineEmits(['click'])
const handleClick = () => {
  emits('click', '子组件的数据')
}
</script>
<style
  lang="scss"
  scoped
></style>
